package com.java1412.controller;

import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author java1412
 * @create 2021-05-20 9:13
 * 以@CrossOrigin注解方式实现跨域访问.@CrossOrigin可以放在控制器上面，也可以放在方法上面
 */
@RestController
public class UserController {
    @CrossOrigin(origins = "http://localhost:8088")
    @GetMapping("/msg")
    public String showMsg() throws Exception {
        return "success";
    }
}